.sx__view-selection {
  position: relative;
  font-size: var(--sx-calendar-header-input-font-size);
}

.sx__view-selection-label {
  position: absolute;
  top: 0;
  inset-inline-start: 12px;
  padding: 0 var(--sx-spacing-padding1);
  background-color: var(--sx-color-background);
  font-size: 0.75rem;
  color: var(--sx-color-neutral);
  line-height: 1rem;
  transform: translateY(-50%);
  transition: transform 0.2s ease-in-out;
  pointer-events: none;
  z-index: 1;

  .is-dark & {
    display: none;
  }
}

.sx__view-selection-selected-item {
  height: 100%;
  width: fit-content;
  padding: var(--sx-spacing-padding3) var(--sx-spacing-padding4);
  cursor: pointer;
  border-radius: var(--sx-rounding-extra-small);
  border: var(--sx-border);
  display: flex;
  align-items: center;
  gap: var(--sx-spacing-padding2);

  &:hover {
    background-color: var(--sx-internal-color-light-gray);

    .is-dark & {
      background-color: var(--sx-color-surface-container-low);
    }
  }
}

.sx__view-selection-chevron {
  width: 1rem;
  height: 1rem;
  pointer-events: none;
  filter: brightness(0.7);
  transition: transform 0.2s ease-in-out;
}

.sx__view-selection.is-open .sx__view-selection-chevron {
  transform: rotate(180deg);
}

.sx__view-selection-items {
  position: absolute;
  top: 100%;
  box-shadow: var(--sx-box-shadow-level3);
  margin: 0;
  background-color: var(--sx-color-background);
  z-index: var(--sx-calendar-header-popup-z-index);

  .is-dark & {
    background-color: var(--sx-color-surface-container-high);
  }
}

.sx__view-selection-item {
  padding: var(--sx-spacing-padding4) var(--sx-spacing-padding6);
  cursor: pointer;

  &:hover,
  &:focus {
    background-color: var(--sx-color-primary);
    color: var(--sx-color-on-primary);
  }

  &.is-selected {
    background-color: var(--sx-color-surface-dim);

    &:hover,
    &:focus {
      background-color: var(--sx-color-primary);
      color: var(--sx-color-on-primary);
    }
  }
}
